package com.telephone.purchase.mapper;

import com.telephone.purchase.entity.User;
import com.telephone.purchase.model.UserInfoModifyRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * @author fengyingeng
 * @date 2019/9/4 8:50
 * Description: 用户信息映射
 */
@Repository
public interface UserMapper {

    /**
     * 更新用户信息
     * @param userInfoModifyRequest
     * @return int
     */
    int updateInfo(UserInfoModifyRequest userInfoModifyRequest);

    /**
     * 修改用户密码
     * @param phoneNumber
     * @param newUserPassword
     * @return int
     */
    int updateUserPassword(@Param("PhoneNumber") String phoneNumber, @Param("UserPassword") String newUserPassword);

    /**
     * 修改支付密码
     * @param phoneNumber
     * @param newPayPassword
     * @return int
     */
    int updatePayPassword(@Param("PhoneNumber") String phoneNumber, @Param("PayPassword") String newPayPassword);

    /**
     * 根据手机号获得用户信息
     * @param PhoneNumber
     * @return user
     */
    User selectByPhoneNumber(@Param("PhoneNumber") String PhoneNumber);
}
